<template>
	<view class="content">
		<view class="search">
			<u-search placeholder="请输入关键字" v-model="search" :animation="true"></u-search>
			<view class="avatar">
				<view class="avatar-box" v-for="(item,index) in avatarData" :key="index">
					<image :src="item.src" class="avatar-image" mode=""></image>
					<view class="avatar-title">{{ item.title }}</view>
				</view>
			</view>
			<view class="shop-content" v-for="(item,index) in shopData" :key="idnex" @click="storeMerchandise">
				<view class="content-title">
					<image :src="item.src" class="avatar-image" mode=""></image>
					<text class="username">{{ item.shopname }}</text>
					<view class="enter-store">
						{{ item.enterstore }}
					</view>
				</view>
				<view class="enter-shop" @click="lookStore">
					进店看看 >
				</view>
				<view class="content-content">
					<view class="content-box">
						<image :src="item.commodityimage" class="content-image" mode=""></image>
						<view class="content-name">{{ item.commodityname }}</view>
						<view class="content-font">
							<text class="font-laft">￥{{ item. discount }}</text>
							<text class="font-right">￥{{ item.original }}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 搜索框数据
				search: '',
				// 头像数据
				avatarData: [{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
					{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
					{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
					{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
					{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
					{
						src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
						title: '全部'
					},
				],
				// 店铺数据信息
				shopData: [{
					src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					shopname: '1',
					enterstore: '6人进店',
					commodityimage: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					commodityname: '测试测试',
					discount: '20',
					original: '20'
				}, {
					src: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					shopname: '1',
					enterstore: '6人进店',
					commodityimage: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					commodityname: '测试测试',
					discount: '20',
					original: '20'
				}, ]
			}
		},
		methods: {
			// 进店看看跳转店铺详情
			lookStore(){
				uni.navigateTo({
					url:'/pages/index/storeDetails/storeDetails'
				})
			},
			// 店铺商品跳转商品详情
			storeMerchandise(){
				uni.navigateTo({
					url:"/pages/index/productDetails/productDetails"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.search {
		padding: 0rpx 20rpx 0rpx 20rpx;
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
	}

	.avatar {
		overflow: auto;
		display: flex;
		width: 100%;
		padding: 0rpx 10rpx 0rpx 20rpx;
		margin-top: 20rpx;
	}

	.avatar-box {
		margin-right: 20rpx;
	}

	.avatar-image {
		width: 100rpx;
		height: 100rpx;
		border-radius: 100%;
	}

	.avatar-title {
		text-align: center;
	}

	.shop-content {
		width: 100%;
		padding-bottom: 20rpx;
		background-color: #9043E9;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
	}

	.content-title {
		display: flex;
		align-items: center;
		padding: 20rpx 0rpx 0rpx 20rpx;
	}

	.username {
		margin-left: 20rpx;
		margin-right: 410rpx;
		color: #fff;
	}

	.enter-store {
		width: 150rpx;
		background-color: rgb(54, 6, 91);
		color: white;
		border-radius: 20rpx 0rpx 0rpx 20rpx;
		text-align: center;
		// padding: 0rpx 10rpx 0rpx 10rpx;
	}

	.enter-shop {
		background-color: #fff;
		border-radius: 40rpx;
		width: 200rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-left: 15rpx;
		margin-top: 20rpx;
	}

	.content-content {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		border-radius: 20rpx;
		margin-left: 20rpx;
		margin-top: 20rpx;
	}

	.content-box {
		width: 49%;
		background-color: #fff;
		border-radius: 20rpx;
	}

	.content-image {
		width: 100%;
		height: 400rpx;
		border-radius: 20rpx;
	}

	.content-name {
		font-size: 40rpx;
	}

	.content-font {
		margin-top: 20rpx;
	}

	.font-laft {
		font-size: 35rpx;
		color: red;
	}

	.font-right {
		text-decoration: line-through;
		color: #ccc;
	}
</style>